@extends('plugin.layout.baseDoing')
@section('add_css')
    <link rel="stylesheet" href="{{ ___('/admin/js/jquery.tagsinput.css') }}">
    <link rel="stylesheet" href="{{ ___('/admin/js/select2/select2.css') }}">
@endsection
@section('content')
    <div class="layui-card">

        <div class="layui-card-body">
            <div class="layui-form layui-form-kongqi" lay-filter="">
                {{ csrf_field() }}
                {{ method_field('PUT') }}

                <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
                    <ul class="layui-tab-title">
                        <li class="layui-this">基本信息</li>

                    </ul>
                    <div class="layui-tab-content">
                        <div class="layui-tab-item layui-show">

                            @include('plugin.tpl.form.text',[
                                'data'=>[
                                    'name'=>'name',
                                    'title'=>'后缀类型',
                                    'tips'=>'',
                                     'value'=>$show->name,
                                    'rq'=>'rq'
                            ]])
                            @include('plugin.tpl.form.text',[
                              'data'=>[
                                  'name'=>'origin_money',
                                  'title'=>'市场价格',
                                  'tips'=>'',
                                  'value'=>$show->origin_money,
                                  'mark'=>'单位(RMB)',
                                  'rq'=>'rq'
                          ]])
                            @include('plugin.tpl.form.text',[
                                'data'=>[
                                    'name'=>'register_money',
                                    'title'=>'首年价格',
                                    'tips'=>'',
                                     'value'=>$show->register_money,
                                    'mark'=>'单位(RMB)',
                                    'rq'=>'rq'
                            ]])
                            @include('plugin.tpl.form.text',[
                                'data'=>[
                                    'name'=>'renewal_money',
                                    'title'=>'续费价格',
                                    'tips'=>'',
                                    'value'=>$show->renewal_money,
                                    'mark'=>'单位(RMB)',
                                    'rq'=>'rq'
                            ]])
                            @include('plugin.tpl.form.text',[
                                'data'=>[
                                    'name'=>'migrate_money',
                                    'title'=>'迁移价格',
                                    'tips'=>'',
                                    'value'=>$show->migrate_money,
                                    'mark'=>'单位(RMB)',
                                    'rq'=>''
                            ]])
                        </div>

                    </div>
                </div>
                @include('admin.tpl.form.submit')
            </div>
        </div>
    </div>

@endsection
@section('foot_js')


    <script>
        layui.use(['index', 'form'], function () {
            var form = layui.form;
            form.on('checkbox', function (data) {
                var check = data.elem.checked;//是否选中
                var checkId = data.elem.id;//当前操作的选项框
                if (check) {
                    //选中
                    var ids = checkId.split("-");
                    if (ids.length == 3) {
                        //第三极菜单
                        //第三极菜单选中,则他的上级选中
                        $("#" + (ids[0] + '-' + ids[1])).prop("checked", true);
                        $("#" + (ids[0])).prop("checked", true);
                    } else if (ids.length == 2) {
                        //第二季菜单
                        $("#" + (ids[0])).prop("checked", true);
                        $("input[id*=" + ids[0] + '-' + ids[1] + "]").each(function (i, ele) {
                            $(ele).prop("checked", true);
                        });
                    } else {
                        //第一季菜单不需要做处理
                        $("input[id*=" + ids[0] + "-]").each(function (i, ele) {
                            $(ele).prop("checked", true);
                        });
                    }
                } else {
                    //取消选中
                    var ids = checkId.split("-");
                    if (ids.length == 2) {
                        //第二极菜单
                        $("input[id*=" + ids[0] + '-' + ids[1] + "]").each(function (i, ele) {
                            $(ele).prop("checked", false);
                        });
                    } else if (ids.length == 1) {
                        $("input[id*=" + ids[0] + "-]").each(function (i, ele) {
                            $(ele).prop("checked", false);
                        });
                    }
                }
                form.render();
            });

        })
    </script>

@endsection